package cn.aloxc.tools.data;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

public class DAO
{
	public static String getTianya(String aurl){
		if(aurl.equals(""))aurl="http://www.tianya.cn/default.htm";
		else{
			if(!aurl.equalsIgnoreCase("http://"))aurl+="http://www.tianya.cn/";
		}
		String ret = "";
		try{
			URL url = new URL(aurl);
			InputStream is = url.openStream();
			InputStreamReader isr = new InputStreamReader(is);
			BufferedReader br = new BufferedReader(isr);
			String str;
			while((str=br.readLine())!=null){
				ret += str;
			}
		}catch(IOException e){
			
		}
		return ret;
	}
}
